home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Bavarian / Bavarian #022 (19xx)(APS Electronic).zip / Bavarian #022 (19xx)(APS Electronic).adf / console.def < prev    next >
Text File  |  1986-11-29  |  3KB  |  71 lines

  1. DEFINITION MODULE Console;
  2.  
  3. (**********************************************************************
  4. ***************           Written by Ed Bartz           ***************
  5. ***************           Copyright  5/21/87            ***************
  6. ***************    This program may be redistributed    ***************
  7. ***************    or modified as long as these         ***************
  8. ***************    notices and all other references     ***************
  9. ***************    to the author remain intack.         ***************
  10. ***************    Also this may not be used for        ***************
  11. ***************    profit by anyone without the         ***************
  12. ***************    express permission of the author.    ***************
  13. **********************************************************************)
  14.  
  15.   FROM Ports IMPORT MsgPortPtr;
  16.   FROM Intuition IMPORT WindowPtr;
  17.   FROM IO IMPORT IOStdReqPtr;
  18.  
  19. TYPE
  20.   Conport = RECORD
  21.      IO : IOStdReqPtr;
  22.      msg : MsgPortPtr;
  23.      buf : ARRAY [0..80] OF CHAR;
  24.   END;
  25.  
  26.  PROCEDURE QueueRead(VAR Rport: Conport);
  27.         (* queue up a read request to a console, show where to
  28.          * put the character when ready to be returned.  Most
  29.          * efficient if this is called right after console is
  30.          * opened *)
  31.  
  32.  PROCEDURE OpenWRConsole(VAR Wport, Rport: Conport; w : WindowPtr):BOOLEAN;
  33. (* Open a console device *)
  34.  
  35.  PROCEDURE OpenWConsole(VAR Wport: Conport; w : WindowPtr):BOOLEAN;
  36. (* Open a console device *)
  37.  
  38.  PROCEDURE OpenRConsole(VAR Rport: Conport; w : WindowPtr):BOOLEAN;
  39. (* Open a console device *)
  40.  
  41.  PROCEDURE CloseWRConsole(Wport, Rport: Conport);
  42. (* Close a console device *)
  43.  
  44.  PROCEDURE CloseWConsole(Wport : Conport);
  45. (* Close a console device *)
  46.  
  47.  PROCEDURE CloseRConsole(Rport: Conport);
  48. (* Close a console device *)
  49.  
  50.  PROCEDURE PutChar(Wport: Conport; c: CHAR);
  51. (* Output a single character to a specified console *)
  52.  
  53.  PROCEDURE Writestr(Wport: Conport; VAR s: ARRAY OF CHAR; len: LONGINT);
  54. (* Output a stream of known length to a console *)
  55.  
  56.  PROCEDURE PutStr(Wport: Conport; VAR s: ARRAY OF CHAR);
  57. (* Output a NULL-terminated string of characters to a console *)
  58.  
  59.  PROCEDURE MayGetChar(VAR Rport: Conport; VAR c: CHAR): BOOLEAN;
  60.         (* see if there is a character to read.  If none, don't wait, 
  61.          * come back with a value of FALSE *)
  62.  
  63.  PROCEDURE GetChar(VAR Rport: Conport; VAR c: CHAR);
  64.         (* go and get a character; put the task to sleep if
  65.          * there isn't one present *)
  66.  
  67.  PROCEDURE GetStr(VAR Rport, Wport: Conport; VAR s: ARRAY OF CHAR): BOOLEAN;
  68.         (* get string from console device *)
  69.  
  70. END Console.
  71.